[アップデート]GuardDutyのランタイムモニタリングに、不審なシェルの作成と権限昇格に関する新しい検出タイプが2つ追加されました

[アップデート]GuardDutyのランタイムモニタリングに、不審なシェルの作成と権限昇格に関する新しい検出タイプが2つ追加されました

Amazon GuardDutyのランタイムモニタリング機能に新しく2つのFinding typeが追加され、ランタイムモニタリングがより多くの脅威に対応出来るようになりました
Clock Icon2024.08.09

こんにちは、AWS事業本部@福岡オフィスのべこみん(@beco_minn)です。

みなさん、Amazon GuardDuty(以下GuardDuty)のランタイムモニタリング機能は利用していますか?

先日、このランタイムモニタリング機能に2つの新たなFinding types(検出タイプ)が追加されました。

どうやら疑わしいシェルの作成と権限昇格に関するFindingsのようです。本記事ではこれらについてご紹介します。

公式の内容は上記Findingsのリンクをご参照ください。
※本記事執筆時点では英語版のユーザーガイドのみ上記内容に更新されています。

なお、このアップデートは本記事執筆時点でGuardDutyのコンソール上でも下図のように紹介されています。

スクリーンショット 2024-08-09 14.19.53.png

新機能: Amazon GuardDuty Runtime Monitoring adds new finding types to detect threats based on suspicious shell creation and privilege escalation
GuardDuty Runtime Monitoring has added two new finding types that will help you detect threat scenarios involving suspicious shell creation on the monitored resource, and privilege escalation where a process suspiciously elevates its privileges to root. 詳細はこちら

(翻訳)
Amazon GuardDuty ランタイムモニタリングに新しいFinding Typesが追加され、不審なシェルの作成と権限の昇格に基づく脅威を検出
GuardDuty ランタイムモニタリングに新しいFinding Typesが2つ追加され、監視リソース上での不審なシェルの作成、およびプロセスが不審に権限をrootに昇格させる権限の昇格を含む脅威シナリオを検出できるようになりました。

ざっくりまとめ

  • ランタイムモニタリングに2つの新たな検出タイプが追加され、EC2やコンテナのランタイム上でより広く脅威を検出出来るようになった
  • Execution:Runtime/SuspiciousShellCreated
    • 「ネットワークアクセス可能なプロセスが対話型シェル(インタラクティブなシェル)を起動した場合に検知される」というもの
  • PrivilegeEscalation:Runtime/ElevationToRoot
    • 「setuidバイナリ実行による不審なroot権限への昇格など、ランタイム上のプロセスが異常または疑わしいと識別された場合に検知される」というもの
    • 通常のsudoコマンド使用に伴うアクティビティは検知しないようになっている

追加されたのはどのようなFinding typeか?

上述の通り、今回追加されたのは以下のFinding typeです。

それではユーザーガイドをもとにそれぞれの内容を確認しましょう。

Execution:Runtime/SuspiciousShellCreated

Execution:Runtime/SuspiciousShellCreated

A network service or network-accessible process on an Amazon EC2 instance, or in a container has started an interactive shell process.
Default severity: Low
Feature: Runtime Monitoring

This finding informs you that a network-accessible service on an Amazon EC2 instance or in a container within your AWS environment has launched an interactive shell. Under certain circumstances, this scenario may indicate post-exploitation behavior. Interactive shells allow attackers to execute arbitrary commands on a compromised instance or container.
The runtime agent monitors events from multiple resources. To identify the affected resource, view Resource type in the findings details in the GuardDuty console. You can view the network-accessible process information in the parent process details.

Remediation recommendations:
If this activity is unexpected, your resource might have been compromised. For more information, see Remediating Runtime Monitoring findings.

引用元: https://docs.aws.amazon.com/guardduty/latest/ug/findings-runtime-monitoring.html#execution-runtime-suspicious-shell-created

(翻訳)
Execution:Runtime/SuspiciousShellCreated

Amazon EC2 インスタンス上またはコンテナ内のネットワークサービスまたはネットワークアクセス可能なプロセスが対話型シェルプロセスを開始しました。
デフォルトの重要度: Low
機能: ランタイムモニタリング
この検出結果は、Amazon EC2 インスタンスまたは AWS 環境内のコンテナ上のネットワークアクセス可能なサービスが対話型シェルを起動したことを通知します。特定の状況下では、このシナリオはエクスプロイト後の行動を示している可能性があります。対話型シェルを使用すると、攻撃者は侵害されたインスタンスまたはコンテナで任意のコマンドを実行できます。
ランタイムエージェントは、複数のリソースからのイベントを監視します。影響を受けるリソースを特定するには、 GuardDuty コンソールの検出結果の詳細でリソース タイプを表示します。親プロセスの詳細で、ネットワーク アクセス可能なプロセス情報を表示できます。

修復の推奨事項:
このアクティビティが予期しないものである場合、リソースが侵害された可能性があります。詳細については、ランタイム監視の検出結果の修復を参照してください。

上記の通りこのFinding typeでは、Webアプリケーションなどネットワークアクセスが可能なプロセスがインタラクティブなシェルプロセスを開始した場合に検知されるようです。デフォルトの重要度(Severity)はLowになっていますね。

ちなみに実は本記事を執筆しながら私はこのFindingsを検出させようとしたのですが、似たFinding typeである Execution:Runtime/SuspiciousCommandExecution:Runtime/ReverseShell が検出されてしまいました。

サービスの性質上あまり詳しいことは書けませんが、検証が終わり次第検証の結果を本項に追記します。

PrivilegeEscalation:Runtime/ElevationToRoot

PrivilegeEscalation:Runtime/ElevationToRoot

A process running on the listed Amazon EC2 instance or container has assumed root privileges.
Default severity: Medium

Feature: Runtime Monitoring

This finding informs you that a process running on the listed Amazon EC2 or in the listed container within your AWS environment has assumed root privileges through unusual or suspicious setuid binary execution. This indicates that a running process has been potentially compromised, for the EC2 instance through an exploit, or through setuid exploitation. By using the root privileges, the attacker can potentially execute commands on the instance or the container.

While GuardDuty is designed to not generate this finding type for activities involving regular use of the sudo command, it will generate this finding when it identifies the activity as unusual or suspicious.
GuardDuty examines related runtime activity and context, and generates this finding type only when the associated activity and context are unusual or suspicious.
The runtime agent monitors events from multiple resources. To identify the affected resource, view Resource type in the findings details in the GuardDuty console.

Remediation recommendations:
If this activity is unexpected, your resource might have been compromised. For more information, see Remediating Runtime Monitoring findings.

引用元: https://docs.aws.amazon.com/guardduty/latest/ug/findings-runtime-monitoring.html#privilegeesc-runtime-elevation-to-root

(翻訳)
PrivilegeEscalation:Runtime/ElevationToRoot

リストされている Amazon EC2 インスタンスまたはコンテナで実行されているプロセスは、ルート権限を取得しています。
デフォルトの重要度: 中
機能: ランタイムモニタリング

この検出結果は、AWS 環境内のリストされた Amazon EC2 上、またはコンテナで実行されているプロセスが、通常とは異なる、または疑わしい setuid バイナリの実行によって root 権限を想定していることを通知らせるものです。これは、実行中のプロセスが、 EC2 インスタンスに対するエクスプロイト、または setuid エクスプロイトによって侵害された可能性があることを示しています。 root 権限を使用することで、攻撃者はインスタンスやコンテナ上でコマンドを実行できる可能性があります。
GuardDuty は、 sudo コマンドの通常使用を伴うアクティビティに対してはこの検出タイプを生成しないように設計されており、アクティビティが異常または疑わしいと識別された場合にこの検出タイプを生成します。
GuardDuty は関連するランタイム アクティビティとコンテキストを調べ、関連するアクティビティとコンテキストが異常または疑わしい場合にのみこの検出タイプを生成します。
ランタイム エージェントは、複数のリソースからのイベントを監視します。影響を受けるリソースを特定するには、GuardDuty コンソールの検出結果の詳細でリソース タイプを表示します。

修復の推奨事項:
このアクティビティが予期しないものである場合、リソースが侵害された可能性があります。詳細については、ランタイム監視の検出結果の修復を参照してください。

一方こちらは権限昇格を検知するFinding typeです。
setuidバイナリが実行されroot権限が付与された怪しい挙動があった場合にこのFindingが検知されるようです。ただし、ユーザーガイドによるとsudoコマンドを利用する通常の動作の際に検知しないように制御されているみたいですね。
こちらは権限昇格ということもあり重要度はMediumになっています。

こちらも先ほどのSuspiciousShellCreated同様、検証が終わり次第結果を追記します。

最後に

ということで、今回のアップデートでランタイムモニタリングがより広く脅威を検知出来るようになりました。

現在ランタイムモニタリングは自動エージェント設定があるため導入も楽で良いですね。

また、上述の通り本記事を執筆しながら各Finding Typesの検証を行なっています。何か進捗があり次第、その内容を随時本記事に追記いたします。

本記事がどなたかのお役に立てれば幸いです。

以上、べこみんでした。

この記事をシェアする

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.